package good.socket;

import java.io.IOException;
import java.net.ServerSocket;
import java.net.Socket;

public class SocketSer {

	public static void main(String[] args) {
		ServerSocket ss = null;
		Socket socket = null;
		try {
			ss = new ServerSocket(8099);
			System.out.println("服务器开启");
			while(true){
				socket = ss.accept();
				SocketThread st=new SocketThread(socket);
				Thread th=new Thread(st, "one");
				th.start();
			}
		} catch (Exception e) {
			
		}finally{
			if(ss!=null){
				try {
					ss.close();
				} catch (IOException e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
				}
			}
			ss=null;
		}
	}

}
